//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "malla.h"
#include "lista.cpp"

//---------------------------------------------------------------------------

#pragma package(smart_init)


void Malla::Dibuja(int grafico){
    for (int i = 1; i <= nc; i++){
        if (grafico == 1)
                glBegin(GL_LINE_LOOP);
        else
                glBegin(GL_POLYGON);

        int numero = cara->dameDato(i)->getNv();
              for (int j = 1; j <= numero; j++){
                   int iv = cara->dameDato(i)->getIv(j);
                   int in = cara->dameDato(i)->getIn(j);
                   glNormal3f(normal->dameDato(in)->getX(),
                              normal->dameDato(in)->getY(),
                              normal->dameDato(in)->getZ()); 
                   glVertex3f(vertice->dameDato(iv)->getX(),
                              vertice->dameDato(iv)->getY(),
                              vertice->dameDato(iv)->getZ());
              }
        glEnd();
    }           
}